20/10/2019

Simple plotly example - iris dataset

Settings

We are going to plot 'Petal Length' vs 'Petal Width', by 'Species'

library(plotly)
library(datasets)
library(dplyr)
data(iris)

Formatting

f <- list(
  family = "Courier New, monospace",
  size = 11,   color = "#6e6e6e" )
x <- list(
  title = "Petal Length",   titlefont = f )
y <- list(
  title = "Petal Width",   titlefont = f )

Plotting

Interpretation

The iris dataset in R provides measurements (in cm) of sepal length and width, and petal length and width of the following 3 species of iris: Iris setosa, versicolor, and virginica. This plot shows relaitonship between petal length and petal width. Different species are shown in different colors.

References